<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'editClient_main.jsp' starting page</title>
    
	<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
	<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" type="text/css" href="css/left_tabmenu.css">
	<script type="text/javascript" src="js/showmenu.js"></script>
	<style type="text/css">
	.input_160{
	BORDER-RIGHT: gray 1px solid;
	BORDER-TOP: gray 1px solid;
	BORDER-LEFT: gray 1px solid;
	BORDER-BOTTOM: gray 1px solid;
	FONT-FAMILY: verdana;
	BACKGROUND-COLOR: window;
	width:160;
	}
	#addr_sum td{width:10%;}
	#title{text-align:right;}
	#content{text-align:left;}
	</style>
	<script language="javascript">  
var XMLHttpReq;  
     //创建XMLHttpRequest对象         
    function createXMLHttpRequest() {  
        if(window.XMLHttpRequest) { //Mozilla 浏览器  
            XMLHttpReq = new XMLHttpRequest();  
        }  
        else if (window.ActiveXObject) { // IE浏览器  
            try {  
                XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");  
            } catch (e) {  
                try {  
                    XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");  
                } catch (e) {}  
            }  
        }  
    }  
    //发送请求函数  
    function sendRequest(url) {  
        createXMLHttpRequest();  
        XMLHttpReq.open("GET", url, true);  
        XMLHttpReq.onreadystatechange = processResponse;//指定响应函数  
        XMLHttpReq.send(null);  // 发送请求  
    }  
    // 处理返回信息函数  
    function processResponse() {  
        if (XMLHttpReq.readyState == 4) { // 判断对象状态  
            if (XMLHttpReq.status == 200) { // 信息已经成功返回，开始处理信息  
                updateMenu();  
            } else { //页面不正常  
                  alert("获取城市列表异常！");  
            }  
        }  
    }  
    //更新菜单函数  
    function updateMenu() {  
    	if(XMLHttpReq.responseText != ""){
    	
        var city=XMLHttpReq.responseText;

        var cityJSON= eval("(" + city + ")");
        
        var cityObj = document.getElementById('city');
       
        cityObj.options.length=0;
        for(var i in cityJSON){ 
       	var opt =new Option(cityJSON[i], i);
       	cityObj.options.add(opt);
		}
		}
		  
    }  
    // 创建级联菜单函数  
    function showCity(obj) {  
        sendRequest("cityCascading.do?provinceCode=" + obj );  
        /**下面这一句的作用是：每次选择后回到第一个选项**/  
        // document.all.mli.options[0].selected=true;  
    }  
  
</script> 
  </head>
 <body>
 <table width="100%" height="100%">
 <tr><td height="20%">
<div id="top">
<table  width="100%">
<tr><td><jsp:include page="../top.jsp" flush="true"></jsp:include></td></tr>
</table>
</div>
</td></tr>
<!--
<hr   size= "1 "   noshade   style= "color:#BCD2EE;   border-style:dotted; "> 
-->
<tr><td height="70%" style="vertical-align:top;">
<div id="main">
<table width="100%" height="100%">
<tr>
<td width="20%" height="500" style="vertical-align:top;border-right:4px #65aaef solid;">
<div id="nav">  
  <div class="title1" id="menu1" onclick="showmenu('1') ">→基本信息</div>
  <div id="list1" class="content" style="display:block">
       <ul>
<li><a href="customer/addGeneral.do?custId=${CustInfo.custId}&isView=1">- 概况</a></li>
<li><a href="dispatch.do?type=Cust_Address&custId=${custId}">- 地址</a></li>
<li><a href="customer/addOperation.do?custId=${CustInfo.custId}&isView=1">- 经营情况</a></li>
<li><a href="view/customer/Customer_Management.jsp">- 管理层情况</a></li>
<li><a href="dispatch.do?type=Cust_Overview&custId=${custId}">- 总览</a></li> 
    </ul>
  </div> 
  <div class="title" id="menu2" onclick="showmenu('2')"><a href="view/customer/AddCustomer_ReportList.jsp" style="text-decoration: none;color:#fff;">→财务信息</a></div>
  <div id="list2" class="content" style="display:none">
    <ul>
    </ul>
  </div> 
<div class="title" id="menu3" onclick="showmenu('3')">→集团客户信息</div>
  <div id="list3" class="content" style="display:none">
    <ul>
<li><a href="#" title="">- 成员信息</a></li>
<li><a href="#" title="">- 集团信息</a></li>
    </ul>
  </div> 
  <div class="title" id="menu4" onclick="showmenu('4')">→银企合作信息</div>
  <div id="list4" class="content" style="display:none">
    <ul>
<li><a href="dispatch.do?type=Cust_Inner&custId=${custId}">- 我行存贷款信息</a></li>
<li><a href="dispatch.do?type=Cust_Outer&custId=${custId}">- 他行存贷款信息</a></li>
<li><a href="dispatch.do?type=Cust_Guarantee&custId=${custId}">- 担保信息</a></li>
    </ul>
  </div> 
    <div class="title" id="menu5" onclick="showmenu('5')">→历史评级信息</div>  
    <div id="list5" class="content" style="display:none">
    <ul>
<li><a href="view/customer/Customer_ExtratRating.jsp">- 外部评级</a></li>
    </ul>
  </div> 
<div class="title" id="menu6" onclick="showmenu('6')"><a href="dispatch.do?type=Cust_Events&custId=${custId}" style="text-decoration: none;color:#fff;">→重大事项</a></div>  
</div>
</td>
<td width="80%" height="100%" style="vertical-align:top" id="right_frame">
<div id="position" align="left">
			<font size="2">当前位置： <a href="" style="text-decoration: none;">首页</a>&gt;&gt;客户管理&gt;&gt;新增客户</font>
		</div>
		<hr />
		<br/>
		<div align="left">
			<img src="images/edit.png" alt="" width="24" height="24"/>
			<font size="2">地址</font>
		</div>
		<hr />
<br/>
<form action="customer/saveAddress.do" method="post">
<table width="100%">
<tr><td>
<table width="100%" align="center" cellpadding="2" cellspacing="1" bgcolor="#DDDDDD" id="addr_sum">
<tr bgcolor="#F3F3F3">
<td>地址类型</td>
<td>国家</td>
<td>省份</td>
<td>城市</td>
<td>街道地址</td>
<td>邮编</td>
<td>电话</td>
<td>传真</td>
<td>网址</td>
<td>选择</td>
</tr>

<c:forEach var ="ca" items="${custAddressList}">
<tr>
<td><c:out value="${DataDictionary['AddressType'][ca.addressType]}"></c:out></td>
<td><c:out value="${DataDictionary['CountryCode'][ca.countryCode]}"></c:out></td>
<td><c:out value="${DataDictionary['RegionCode'][ca.provinceCode]}"></c:out></td>
<td><c:out value="${DataDictionary['RegionCode'][ca.cityCode]}"></c:out></td>
<td><c:out value="${ca.addressDesc}"></c:out></td>
<td><c:out value="${ca.postCode}"></c:out></td>
<td><c:out value="${ca.tel}"></c:out></td>
<td><c:out value="${ca.fax}"></c:out></td>
<td><c:out value="${ca.webSiteUrl}"></c:out></td>
<td><input type="checkbox" name="selectAddress" checked="checked" value="${ca.serialNo}"/></td>
</tr>
</c:forEach>
</table>
</td></tr>
<tr>
</tr>
<tr><td width="100%"><table style="margin: auto;width:20%;"><tr><td id="save"><br></td><td height="50"><input type="submit" value="保存"></td><td><br></td><td height="50"><input type="reset" value="取消"></td><td id="delete"></td></tr></table></td></tr>
</form>
<tr><td width="100%" height="50"><hr   size= "1 "   noshade   style= "color:#000;border-style:dotted; "></td></tr>
<tr><td width="100%">


<form action="customer/addAddress.do" method="post">
<table width="80%"  border="0" cellpadding="5" cellspacing="5" style="margin:auto;">
<tr>
<td bgcolor="#FFFFFF" id="title">地址类型</td>
<td bgcolor="#FFFFFF" id="content">
<select name="addressType" class="select">
<c:forEach var="entry" items="${DataDictionary['AddressType']}">
<option value="<c:out value="${entry.key}" />"><c:out value="${entry.value}" /></option>
</c:forEach>
</select>
*</td>
<td bgcolor="#FFFFFF" id="title">国家</td>
<td bgcolor="#FFFFFF" id="content">
<select name="countryCode" class="country">
<option value="142" selected>中国</option>
<c:forEach var="entry" items="${Country}">
<option value="<c:out value="${entry.key}" />"><c:out value="${entry.value}" /></option>
</c:forEach>
</select>
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#FFFFFF" id="title">省市</td>
<td id="content" colspan="3">
<select name="provinceCode" class="select" id="province" onchange="showCity(this.options[this.options.selectedIndex].value)">
<option value=''>请选择省份...</option>  
<c:forEach var="entry" items="${City}">
<option value="<c:out value="${entry.key}"/>"><c:out value="${DataDictionary['RegionCode'][entry.key]}"/></option>
</c:forEach>
</select>
<select name="cityCode" class="city" id="city"> 
</select>
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#FFFFFF" id="title">街道地址</td>
<td id="content" colspan="3"><input name="addressDesc" type="text" class="input_160" style="width:380;">
*</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" id="title">邮编</td>
<td id="content"><input name="postCode" id="post" type="text" class="input_160">
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#FFFFFF" id="title">电话</td>
<td id="content"><input name="tel" type="text" class="input_160">
*</td>
<td bgcolor="#FFFFFF" id="title">传真</td>
<td id="content"><input name="fax" type="text" class="input_160"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#FFFFFF" id="title">网址</td>
<td id="content" colspan="3"><input name="webSiteUrl" type="text" class="input_160" style="width:380;"></td>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr><td></td><td></td><td><table style="margin: auto;width:20%;"><tr><td id="save"><br></td><td height="50"><input type="submit" value="保存"></td><td><br></td><td height="50"><input type="reset" value="取消"></td><td id="delete"></td></tr></table></td></tr>
</table>
</form>
</td>
</tr>
<tr><td height="20"></td></tr>
<tr><td width="100%" style="text-align:center;"><table width="20%" style="margin: auto;"><tr><td id="add"></td><td></td><td id="reset"></td></tr></table></td></tr>
</table>
</td>
</tr>
</table>
</div>
</td></tr>
<!--<hr   size= "1 "   noshade   style= "color:#BCD2EE;   border-style:dotted; "> 
-->
<tr><td height="10%" style="vertical-align:bottom;">
<div id="footer">
<table  width="100%">
<tr><td style="vertical-align:bottom;text-align:center;"><jsp:include page="../bottom.jsp"></jsp:include></td></tr>
</table>
</div>
</td></tr>
</table>
  </body>
</html>
